<?php

class ManageDoDeleteHyperlinkAction extends LtAction
{
	public function __construct()
	{
		parent::__construct();
		$this->responseType = 'tpl';
		$this->layout = 'bylayout';
	}

	public function execute()
	{
		$linkidtodel = $this->context->get('linkid');
		//var_dump($postdata);exit;

		if(!empty($linkidtodel))
		{
			$tmcustomer = new HyperlinkDao();
			$delre  = $tmcustomer->delByid($linkidtodel);
			if($delre)
			{
				$noticeStr = "succ to do del, linkid=".$linkidtodel;
			}
			else
			{
				$noticeStr = "fail to do del, db return false";
			}
		}
		else
		{
			$noticeStr = "fail to do del, no linkid";
		}

		$redirectUrl = C('LtUrl')->generate('manage','Hyperlink', array('noticestr'=>($noticeStr)));
		//$noticeStr = 'in ManageDoAddCustomerAction:execute';
		header('Location: '.$redirectUrl);
	}
}
?>
